<div>
    <el-row style="margin: 10px;">
        <el-col :span="13">
            <el-card>
            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm"
                     @submit.native.prevent>
                <el-form-item label="上传xml资源文件" v-if="haveFile">
                    <el-upload
                            accept=".xml"
                            class="upload-demo"
                            ref="upload"
                            name="file"
                            :data="ruleForm"
                            drag
                            action="/simpledevelop/upgrade/upgrade"
                            :file-list="fileList"
                            :auto-upload="false">
                        <i class="el-icon-upload"></i>
                        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
                    </el-upload>
                </el-form-item>
                <el-form-item label="升级类表名" prop="tableName" v-if="buildTable">
                    <el-input v-model="ruleForm.tableName" name="path" placeholder="数据库表名"></el-input>
                </el-form-item>
                <el-form-item label="升级类表字段" v-if="buildTable" class="mytable">
                    <el-table :data="ruleForm.tableData" border style="width: 100%;" :row-style="{height:10+'px'}"
                              :cell-style="{padding:0+'px'}"
                              :header-cell-style="{background:'#F5F7FA',color:'#606266', height:'8px', padding:'0px'}">
                        <el-table-column prop="date" label="字段名" align="center" :render-header="addTooltip"
                                         min-width="46%">
                            <template slot-scope="scope">
                                <el-input v-model="scope.row.field" name="path" placeholder="字段名"
                                          @dblclick.native="addNewRow(scope.$index)"
                                          @keyup.native="fieldKeyUp(scope.$index,$event)"></el-input>
                            </template>
                        </el-table-column>
                        <el-table-column prop="name" label="类型" align="center" min-width="30%">
                            <template slot-scope="scope">
                                <el-select v-model="scope.row.type" placeholder="字段类型">
                                    <el-option value="">请选择</el-option>
                                    <el-option value="INTEGER">INTEGER(整型)</el-option>
                                    <el-option value="DOUBLE">DOUBLE(浮点型)</el-option>
                                    <el-option value="LONG">LONG(长整型)</el-option>
                                    <el-option value="STRING">STRING(字符串)</el-option>
                                    <el-option value="DATE">DATE(日期)</el-option>
                                    <el-option value="TIME">TIME(时间)</el-option>
                                    <el-option value="DATETIME">DATETIME(日期时间)</el-option>
                                    <el-option value="ASCII">ASCII(大文本)</el-option>
                                    <el-option value="BINARY">BINARY(二进制)</el-option>
                                    <!--                                    <el-option value="SET">SET(集合)</el-option>-->
                                    <!--                                    <el-option value="UNKNOWN">UNKNOWN(未知)</el-option>-->
                                    <!--                                    <el-option value="ARRAY">ARRAY(数组)</el-option>-->
                                    <el-option value="BIGINT">BIGINT(精确整型)</el-option>
                                    <el-option value="BIGDECIMAL">BIGDECIMAL(精确浮点型)</el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column prop="address" label="主键？" align="center" min-width="12%">
                            <template slot-scope="scope">
                                <el-checkbox-group v-model="scope.row.prikey">
                                    <el-checkbox @change="test(scope.$index, 'pri')"></el-checkbox>
                                </el-checkbox-group>
                            </template>
                        </el-table-column>
                        <el-table-column prop="address" label="非空？" align="center" min-width="12%">
                            <template slot-scope="scope">
                                <el-checkbox-group v-model="scope.row.isnull">
                                    <el-checkbox @change="test(scope.$index, 'notNull')"></el-checkbox>
                                </el-checkbox-group>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-form-item>
                <el-form-item label="扩展包路径" prop="path" v-if="isLocation">
                    <el-input v-model="ruleForm.path" name="path" placeholder="具体到扩展包项目即可" @blur="initProject"
                              @keyup.enter.native="submitUpload"></el-input>
                </el-form-item>
                <el-form-item label="Module" prop="module" v-if="haveModule">
                    <el-select v-model="ruleForm.module" placeholder="请选择Module" @change="init">
                        <el-option :value="module" v-for="module in modulesList">{{module}}</el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="扩展属性" prop="extendJson">
                    <el-input v-model="ruleForm.extendJson" name="extendJson" clearable @keyup.enter.native="submitForm"></el-input>
                </el-form-item>
                <el-form-item label="可勾选项" prop="type">
                    <el-checkbox-group v-model="ruleForm.configs">
                        <el-checkbox label="location" name="configs" @change="changeisLocation">本地模式</el-checkbox>
                        <el-checkbox label="buildTable" name="configs" @change="changebuildTable" v-if="!haveFile">构建表
                        </el-checkbox>
                        <el-checkbox label="buildTableEntity" name="configs" @change="changebuildEntity"
                                     v-if="!haveFile && buildTable">构建表实体
                        </el-checkbox>
                        <el-checkbox label="buildTableEntityDAO" name="configs"
                                     v-if="!haveFile && buildTable && buildEntity">构建表实体DAO
                        </el-checkbox>
                        <el-checkbox label="less85" name="configs" > 版本小于等于85
                        </el-checkbox>
                    </el-checkbox-group>
                </el-form-item>
                <el-form-item label="构建类型">
                    <el-radio-group v-model="ruleForm.type" @change="changeType">
                        <el-radio label="UpgradeTask" name="type">升级类</el-radio>
                        <el-radio label="PostTask" name="type">资源升级类</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item v-if="haveModule">
                    <el-button type="primary" @click="submitUpload">立即创建</el-button>
                    <el-button>重置</el-button>
                </el-form-item>
            </el-form>
            </el-card>
        </el-col>
        <el-col :span="11">
            <el-card>
                <div v-if="ruleForm.type == 'PostTask'">
                    资源升级类的当前版本列表(在填入扩展包路径会后更新)
                    <br>
                </div>
                <div v-else>
                    升级类的当前版本列表(在填入扩展包路径会后更新)
                    <br>
                </div>
                <div class="tag-group">
                    <el-tag
                            v-for="(version,j) in versionList"
                            :key="version"
                            :type="version"
                            effect="dark" style="margin-right: 4px;margin-top: 4px;">
                        {{ version }}
                    </el-tag>
                </div>
            </el-card>
        </el-col>
    </el-row>
</div>